package com.woniuxy.finance.controller;

import com.woniuxy.commons.request.ResPage;
import com.woniuxy.commons.request.ResponseResult;
import com.woniuxy.finance.entity.Search;
import com.woniuxy.finance.entity.vo.financeVo;
import com.woniuxy.finance.service.RechargeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@RestController
@RequestMapping("/recharge")
public class RechargeController {
    @Resource
    private RechargeService rechargeService;

    @PostMapping("/findAll/{page}/{size}")
    public ResponseResult<ResPage<List<financeVo>>> findAll(@PathVariable("page") Integer page, @PathVariable("size") Integer size){

        return new ResponseResult<>(ResponseResult.OK, rechargeService.findAll(page, size));
    }
    @PostMapping("/findByCondition")
    public ResponseResult<ResPage<List<financeVo>>> findByCondition(@RequestBody Search search){

        return new ResponseResult<>(ResponseResult.OK, rechargeService.findByCondition(search));
    
    }
}
